package com.constant;

public class ServiceConstan {

    public static String getValue(String packageStr, String className) {
        return "package " + packageStr + ";\n" +
                "\n" +
                "public interface " + className + " {\n" +
                "\n" +
                "    ResponseResult insert();\n" +
                "\n" +
                "    ResponseResult update();\n" +
                "\n" +
                "    ResponseResult delete(Integer id);\n" +
                "\n" +
                "    ResponseResult select();" +
                "\n" +
                "}";
    }

    public static String getServiceImplValue(String servicePackageStr, String serviceClassName) {
        return "package " + servicePackageStr + ";\n" +
                "\nimport lombok.extern.slf4j.Slf4j;\n" +
                "import org.springframework.beans.factory.annotation.Autowired;\n" +
                "import org.springframework.stereotype.Service;" +
                "\n" +
                "\n" +
                "@Service\n" +
                "@Slf4j\n" +
                "public class " + serviceClassName + "Impl implements " + serviceClassName + " {\n" +
                "\n" +
                "    @Autowired\n" +
                "    private " + serviceClassName.substring(0, serviceClassName.length() - "Service".length()) + "Mapper mapper;" +
                "\n" +
                "\n" +
                "\n" +
                "    @Override\n" +
                "    public ResponseResult insert() {\n" +
                "        return new ResponseResult<>().success();\n" +
                "    }\n" +
                "\n" +
                "    @Override\n" +
                "    public ResponseResult update() {\n" +
                "        return new ResponseResult<>().success();\n" +
                "    }\n" +
                "\n" +
                "    @Override\n" +
                "    public ResponseResult delete(Integer id) {\n" +
                "        return new ResponseResult<>().success();\n" +
                "    }\n" +
                "\n" +
                "    @Override\n" +
                "    public ResponseResult select() {\n" +
                "        return new ResponseResult<>().success();\n" +
                "    }\n" +
                "}";
    }

}
